<template>
  <el-dropdown :show-timeout="100" trigger="click">
    <el-button plain>
      {{ originStatus[origin] }}
      <i class="el-icon-caret-bottom el-icon--right" />
    </el-button>
    <el-dropdown-menu slot="dropdown" class="no-padding">
      <el-dropdown-item>
        <el-radio-group v-model="origin" style="padding: 10px;">
          <el-radio :label="0">
            原创
          </el-radio>
          <el-radio :label="1">
            转载
          </el-radio>
          <el-radio :label="2">
            混合
          </el-radio>
        </el-radio-group>
      </el-dropdown-item>
    </el-dropdown-menu>
  </el-dropdown>
</template>
<!--
Original: 0, // 原创
Reprint: 1, // 转载
Hybrid: 2 // 混合
-->
<script>
export default {
  props: {
    value: {
      type: Number,
      default: 0
    }
  },
  data() {
    return {
      originStatus: {
        0: '原创', // 原创
        1: '转载', // 转载
        2: '混合' // 混合
      }
    }
  },
  computed: {
    origin: {
      get() {
        return this.value
      },
      set(val) {
        this.$emit('input', val)
      }
    }
  }
}
</script>
